﻿using System;
using Reflector.CodeModel;

namespace CallGraphExtractor.CecilAdapter
{
    class MethodBody : IMethodBody
    {
        #region Fields

        private Mono.Cecil.Cil.MethodBody mMethodBody;

        #endregion Fields

        #region Lifecycle

        public MethodBody(Mono.Cecil.Cil.MethodBody methodBody)
        {
            //if (methodBody == null)
            //    throw new ArgumentNullException("methodBody");
            this.mMethodBody = methodBody;
        }

        #endregion Lifecycle

        #region IMethodBody Members

        public IExceptionHandlerCollection ExceptionHandlers
        {
            get { throw new NotImplementedException(); }
        }

        public bool InitializeLocalVariables
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public IInstructionCollection Instructions
        {
            get { return new InstructionCollection(mMethodBody.Instructions); }
        }

        public IVariableDeclarationCollection LocalVariables
        {
            get { throw new NotImplementedException(); }
        }

        public int MaxStack
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        #endregion
    }
}
